package com.zjut.an.file.manager;

import java.util.List;

import javax.annotation.Resource;

import com.zjut.an.file.dao.AnFile;
import com.zjut.an.file.dao.AnFileDAO;
import com.zjut.an.util.module.PageModule;

public class AnFileManager {

	@Resource(name = "AnFileDAO")
	private AnFileDAO dao;
	
	public void addData(AnFile obj) {	
		dao.save(obj);
	}
	
	public void deleteData(AnFile obj) {
		dao.delete(obj);
	}

	public void deleteDatas(List<AnFile> objllegeList) {
		for (AnFile AnFile : objllegeList) {
			dao.delete(AnFile);
		}
	}
	
	public PageModule getDataByInstance (int pageNumber,int pageSize, String sort, String order,AnFile obj) {
		return dao.findByInstance(pageNumber, pageSize, sort, order, obj);
	}
	
	public List getDatas() {
		return dao.findAll();
	}

	public AnFile getData(int objId) {
		return dao.findById(objId);
	}
	
	public List getDatasByNeId(int neId) {
		return dao.findByNeId(neId);
	}
}
